package com.mvvm.ktnet.ui.testViewPager2

import androidx.lifecycle.SavedStateHandle
import com.mvvm.ktnet.base.viewmodel.BaseViewModel

class ViewPager2ViewModel(val save: SavedStateHandle) : BaseViewModel() {

    var time = 0L

    fun setTimeSave(time: Long) {
        save.set("time", time)
    }
    fun getTimeSave(): Long {
        if (!save.contains("time")) {
            save.set("time", -1L)
        }
        return save.get<Long>("time") ?: -1
    }

}